import Example from '~/components/example'
import { Code } from '~/components/text/code'
import { HeadersTable, Row, Cell, BoldCell } from '~/components/api/table'

export const meta = {
  editUrl: 'pages/docs/api/v1/api-docs-mdx/api-basics/rate-limits.mdx',
  lastEdited: '2019-01-04T22:52:33.000Z'
}

## Rate Limits

We limit the number of calls you can make over a certain period of time.
Rate limits vary and are specified by the following header in all responses:

<HeadersTable>
  <Row>
    <BoldCell>X-Rate-Limit-Limit</BoldCell>
    <Cell>
      The maximum number of requests that the consumer is permitted to make per
      minute.
    </Cell>
  </Row>
  <Row>
    <BoldCell>X-Rate-Limit-Remaining</BoldCell>
    <Cell>
      The number of requests remaining in the current rate limit window.
    </Cell>
  </Row>
  <Row>
    <BoldCell>X-Rate-Limit-Reset</BoldCell>
    <Cell>
      The time at which the current rate limit window resets in UTC epoch
      seconds.
    </Cell>
  </Row>
</HeadersTable>

When the rate limit is **exceeded** an error is returned with the status **429 Too Many Requests**:

<Example>
  <Code lang="json">{`{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded",
  }
}`}</Code>
</Example>
